package com.example.demo.util;

import org.springframework.util.StreamUtils;

import java.io.Closeable;
import java.io.IOException;
import java.io.OutputStream;

/**
 * @Author x c
 * @Email 378661553@qq.com
 * @Date Created in 2020/1/3 11:33
 */
public class StreamUtil extends StreamUtils {


    public static void write(byte[] bytes, int off, int len, OutputStream outputStream) throws IOException {
        outputStream.write(bytes, off, len);
    }

    public static void close(Closeable... closeable) {
        if (closeable != null && closeable.length > 0) {
            for (Closeable item : closeable) {
                if (item != null) {
                    try {
                        item.close();
                    } catch (IOException e) {
                    }
                }
            }
        }
    }
}
